package com.android.personal.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

public class FinanceDatabaseHelper extends SQLiteOpenHelper {

	public FinanceDatabaseHelper(Context context, String name,
			CursorFactory factory, int version) {
		super(context, name, factory, version);
	}
	
	public void onCreate(SQLiteDatabase db) {

		db.execSQL(FinanceDataTags.DATABASE_CREATE_ACCOUNTS);
        db.execSQL(FinanceDataTags.DATABASE_CREATE_OPERATIONS);
    }
    
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    	db.execSQL("DROP TABLE IF EXISTS accounts");
    	db.execSQL("DROP TABLE IF EXISTS operations");
        onCreate(db);
    }
}
